home *** CD-ROM | disk | FTP | other *** search
- Path: vax.sbu.ac.uk!tonyh
- From: tonyh@vax.sbu.ac.uk
- Newsgroups: comp.lang.c++
- Subject: Using ARGV on VAX - How?
- Date: 5 Jan 96 09:49:56 GMT
- Organization: South Bank University
- Message-ID: <1996Jan5.094956.1@vax.sbu.ac.uk>
- NNTP-Posting-Host: vax.sbu.ac.uk
-
- Hi out there everyone,
-
- Just a quickie, how do i get VAX to execute the argv
- command in C.
-
- I include stdio.h and stdlib.h, the file is called myfile.c :
-
- main (int argc, char *argv[])
- {
- if (argv != 2) {
- printf("you forgot to enter your name");
- exit(1);
- }
- printf("Hello %s", argv[1]);
- }
-
- when i type exe myfile.c tony it should produce 'Hello Tony'
- but all i get is :
-
- "you forgot to enter your name"
-
- can someone email me (if possible) and tell me what I'm doing wrong?
-
-